package flc.ast.fragment;

import androidx.fragment.app.Fragment;

import android.view.View;

import com.stark.calculator.unit.constant.ConvertType;

import flc.ast.R;
import flc.ast.activity.AreaActivity;
import flc.ast.activity.CaloriesActivity;
import flc.ast.activity.IncomeActivity;
import flc.ast.activity.LengthActivity;
import flc.ast.activity.PowerActivity;
import flc.ast.activity.PressureActivity;
import flc.ast.activity.ReckonerActivity;
import flc.ast.activity.SpeedActivity;
import flc.ast.activity.TemperatureActivity;
import flc.ast.activity.TimeActivity;
import flc.ast.activity.VolumeActivity;
import flc.ast.activity.WeightActivity;
import flc.ast.databinding.FragmentToolBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link ToolFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class ToolFragment extends BaseNoModelFragment<FragmentToolBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_tool;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);
        mDataBinding.ivReckoner.setOnClickListener(this);
        mDataBinding.ivIncome.setOnClickListener(this);
        mDataBinding.ivLength.setOnClickListener(this);
        mDataBinding.ivArea.setOnClickListener(this);
        mDataBinding.ivVolume.setOnClickListener(this);
        mDataBinding.ivWeight.setOnClickListener(this);
        mDataBinding.ivTemperature.setOnClickListener(this);
        mDataBinding.ivSpeed.setOnClickListener(this);
        mDataBinding.ivPower.setOnClickListener(this);
        mDataBinding.ivCalories.setOnClickListener(this);
        mDataBinding.ivPressure.setOnClickListener(this);
        mDataBinding.ivTime.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.ivReckoner:
                startActivity(ReckonerActivity.class);
                break;
            case R.id.ivIncome:
                startActivity(IncomeActivity.class);
                break;
            case R.id.ivLength:
                startActivity(LengthActivity.class);
                break;
            case R.id.ivArea:
                startActivity(AreaActivity.class);
                break;
            case R.id.ivVolume:
                startActivity(VolumeActivity.class);
                break;
            case R.id.ivWeight:
                startActivity(WeightActivity.class);
                break;
            case R.id.ivTemperature:
                startActivity(TemperatureActivity.class);
                break;
            case R.id.ivSpeed:
                startActivity(SpeedActivity.class);
                break;
            case R.id.ivPower:
                startActivity(PowerActivity.class);
                break;
            case R.id.ivCalories:
                startActivity(CaloriesActivity.class);
                break;
            case R.id.ivPressure:
                startActivity(PressureActivity.class);
                break;
            case R.id.ivTime:
                startActivity(TimeActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}